Page Index
11 A Email邮件发送功能
JL 于 2022-03-02 16:28:10 +08:00 修改了此页面
此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

JooLun版本

  • V2.7.1+

Email SDK

Email配置

  • nacos中joolun-upms-admin-dev.yml配置文件email:标签
#邮箱配置
email:
  # 固定填smtpdm.aliyun.com
  mailSmtpHost: smtpdm.aliyun.com
  mailSmtpUsername: xxxxxxxxx
  mailSmtpPassword: xxxxxxxxxxx
  # 自己定义
  siteName: JooLun

服务中使用

  • 服务中引用
    <!--email-->
    <dependency>
        <groupId>com.joolun</groupId>
        <artifactId>base-common-email</artifactId>
    </dependency>
    
  • 代码中使用
    private final EmailUtils emailUtil;
    ....
    emailUtil.sendEmail(to, title, content);